package com.buer.train.business.service.impl;

import com.buer.train.business.dao.DictDao;
import com.buer.train.business.domain.DictDO;
import com.buer.train.business.service.DictService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;



@Service
public class DictServiceImpl implements DictService {
	@Autowired
	private DictDao dictDao;
	
	@Override
	public DictDO get(Integer id){
		return dictDao.get(id);
	}
	
	@Override
	public List<DictDO> list(Map<String, Object> map){
		return dictDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return dictDao.count(map);
	}
	
	@Override
	public int save(DictDO dict){
		return dictDao.save(dict);
	}
	
	@Override
	public int update(DictDO dict){
		return dictDao.update(dict);
	}
	
	@Override
	public int remove(Integer id){
		return dictDao.remove(id);
	}
	
	@Override
	public int batchRemove(Integer[] ids){
		return dictDao.batchRemove(ids);
	}

    @Override
    public PageInfo<DictDO> getDictList(Map<String, Object> map) {
        PageHelper.startPage(map); //开始起始页
        List<DictDO> list = dictDao.getDictList(map); // 获取数据
        PageInfo<DictDO> page = new PageInfo<>(list); // 实例化PageInfo
        return page;
    }

    @Override
    public DictDO getOne(Map<String, Object> map){
        return dictDao.getOne(map);
    }
	
}
